package cn.wolfcode.qo;

import cn.wolfcode.myenum.MessageEnum;
import cn.wolfcode.utils.DateUtil;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;


/**
 * @author 杨兴健
 * @Date 2020/7/24 18:30
 */
@Getter
@Setter
public class CustomerReportQuery extends QueryObject {
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date beginDate;

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date endDate;

    private String groupType = "e.name";

    public String getTpyeName() {
        return MessageEnum.getTypeName(groupType);
    }

    public Date getEndDate() {
        return DateUtil.getEndTime(this.endDate);
    }

}
